import 'package:get/get.dart';
import 'package:sprintf/sprintf.dart';
import 'package:yt_devops/pages/devices/device_tab/model/device_item_model.dart';
import 'package:yt_devops/resources/str_res_keys.dart';
import 'package:yt_devops/utils/formats.dart';
import 'package:yt_devops/utils/self_develop_formats.dart';

class PcsDetailModel {
  List<DetailItemModel> runItems = [
    DetailItemModel(
      label: 'siteMonitor.workingCondition'.tr, //  '工作状态',
      field: 'WorkStatus',
    ),
    DetailItemModel(
      label: 'siteMonitor.systemFaultWord'.tr, // '系统故障字',
      field: 'SystemFault',
    ),
    DetailItemModel(
      label: '${'siteMonitor.hardwareFaultWord'.tr}1', // '硬件故障字1',
      field: 'HardwareFault1',
    ),
    DetailItemModel(
      label: '${'siteMonitor.hardwareFaultWord'.tr}2,', // '硬件故障字2',
      field: 'HardwareFault2',
    ),
    DetailItemModel(
      label: 'siteMonitor.gridFaultWord'.tr, //   '电网故障字',
      field: 'GridFault',
    ),
    DetailItemModel(
      label: 'siteMonitor.busFaultWord'.tr, //'母线故障字',
      field: 'BusFault',
    ),
    DetailItemModel(
      label: 'siteMonitor.switchFaultWord'.tr, // '开关故障字',
      field: 'SwitchFault',
    ),
    DetailItemModel(
      label: 'siteMonitor.acCapacitorFaultWord'.tr, //'交流电容故障字',
      field: 'AcCapacitorFault',
    ),
    DetailItemModel(
      label: 'siteMonitor.otherFaultWord'.tr, // '其他故障字',
      field: 'OtherFault',
    ),
    DetailItemModel(
      label: 'siteMonitor.currentActualChargeDischargeWorkingMode'.tr,
      // '当前实际充放电工作模式',
      field: 'CurrentChargingAndDischargingModel',
    ),
  ];

  List<DetailItemModel> exchargeItems = [
    DetailItemModel(
      label: sprintf(ResKey.deviceOutputLineVoltage.tr, ['AB']), // '输出AB线电压',
      field: 'Uab',
    ),
    DetailItemModel(
      label: sprintf(ResKey.deviceOutputLineVoltage.tr, ['BC']), //'输出BC线电压',
      field: 'Ubc',
    ),
    DetailItemModel(
      label: sprintf(ResKey.deviceOutputLineVoltage.tr, ['CA']), // '输出CA线电压',
      field: 'Uca',
    ),
    DetailItemModel(
      label: sprintf(ResKey.deviceOutputLineVoltage.tr, ['A']), //'输出A相电压',
      field: 'Ua',
    ),
    DetailItemModel(
      label: sprintf(ResKey.deviceOutputLineVoltage.tr, ['B']), //'输出B相电压',
      field: 'Ub',
    ),
    DetailItemModel(
      label: sprintf(ResKey.deviceOutputLineVoltage.tr, ['C']), //'输出C相电压',
      field: 'Uc',
    ),
    DetailItemModel(
        label: sprintf(ResKey.deviceOutputPhaseCurrent.tr, ['A']), // '输出A相电流',
        field: 'OutputIa',
        format: Formates.currentFormat),
    DetailItemModel(
        label: sprintf(ResKey.deviceOutputPhaseCurrent.tr, ['B']), //'输出B相电流',
        field: 'OutputIb',
        format: Formates.currentFormat),
    DetailItemModel(
        label: sprintf(ResKey.deviceOutputPhaseCurrent.tr, ['C']), //'输出C相电流',
        field: 'OutputIc',
        format: Formates.currentFormat),
    DetailItemModel(
        label:
            sprintf(ResKey.deviceInductancePhaseCurrent.tr, ['A']), //'电感A相电流',
        field: 'inductanceIa',
        format: Formates.currentFormat),
    DetailItemModel(
        label:
            sprintf(ResKey.deviceInductancePhaseCurrent.tr, ['B']), //'电感B相电流',
        field: 'inductanceIb',
        format: Formates.currentFormat),
    DetailItemModel(
        label:
            sprintf(ResKey.deviceInductancePhaseCurrent.tr, ['C']), //'电感C相电流',
        field: 'inductanceIc',
        format: Formates.currentFormat),
    DetailItemModel(
        label:
            sprintf(ResKey.deviceAcActivePowerPhase.tr, ['A']), // '交流A相有功功率',
        field: 'Pa',
        format: Formates.powerFormat),
    DetailItemModel(
        label:
            sprintf(ResKey.deviceAcActivePowerPhase.tr, ['B']), // '交流B相有功功率',
        field: 'Pb',
        format: Formates.powerFormat),
    DetailItemModel(
        label: sprintf(ResKey.deviceAcActivePowerPhase.tr, ['C']), //'交流C相有功功率',
        field: 'Pc',
        format: Formates.powerFormat),
    DetailItemModel(
        label:
            sprintf(ResKey.deviceAcPhaseApparentPower.tr, ['A']), //'交流A相视在功率',
        field: 'Sa',
        format: Formates.kVAFormat),
    DetailItemModel(
        label:
            sprintf(ResKey.deviceAcPhaseApparentPower.tr, ['B']), // '交流B相视在功率',
        field: 'Sb',
        format: Formates.kVAFormat),
    DetailItemModel(
        label:
            sprintf(ResKey.deviceAcPhaseApparentPower.tr, ['C']), //'交流C相视在功率',
        field: 'Sc',
        format: Formates.kVAFormat),
    DetailItemModel(
        label:
            sprintf(ResKey.deviceAcReactivePowerPhase.tr, ['A']), //'交流A相无功功率',
        field: 'Qa',
        format: Formates.noPowerFormat),
    DetailItemModel(
        label:
            sprintf(ResKey.deviceAcReactivePowerPhase.tr, ['B']), // '交流B相无功功率',
        field: 'Qb',
        format: Formates.noPowerFormat),
    DetailItemModel(
        label:
            sprintf(ResKey.deviceAcReactivePowerPhase.tr, ['C']), //'交流C相无功功率',
        field: 'Qc',
        format: Formates.noPowerFormat),
    DetailItemModel(
        label: 'siteMonitor.acOutputTotalActivePower'.tr, //'交流输出总有功功率',
        field: 'P',
        format: Formates.powerFormat),
    DetailItemModel(
        label: 'siteMonitor.acOutputTotalReactivePower'.tr, //'交流输出总无功功率',
        field: 'Q',
        format: Formates.noPowerFormat),
    DetailItemModel(
        label: 'siteMonitor.acOutputTotalApparentPower'.tr, //'交流输出总视在功率',
        field: 'S',
        format: Formates.kVAFormat),
    DetailItemModel(
        label: 'siteMonitor.gridFrequency'.tr, // '电网频率',
        field: 'Freq',
        format: Formates.frequencyFormat),
    DetailItemModel(
        label: 'siteMonitor.currentPhasePowerGrid'.tr, //'电网当前相序',
        field: 'GridPhaseSequence'),
    DetailItemModel(
        label: 'siteMonitor.acPowerFactor'.tr, // '交流功率因数',
        field: 'COS'),
  ];

  List<DetailItemModel> directCurrentItems = [
    DetailItemModel(
      label: 'siteMonitor.totalBusVoltage'.tr, //'总母线电压',
      field: 'totalBusVoltage',
    ),
    DetailItemModel(
      label: 'siteMonitor.positiveBusVoltage'.tr, // '正母线电压',
      field: 'positiveBusVoltage',
    ),
    DetailItemModel(
      label: 'siteMonitor.negativeBusVoltage'.tr, //'负母线电压',
      field: 'negativeBusVoltage',
    ),
    DetailItemModel(
      label: 'siteMonitor.batteryVoltage'.tr, //'电池电压',
      field: 'BatteryVoltage',
    ),
    DetailItemModel(
        label: 'siteMonitor.batteryCurrent'.tr, // '电池电流',
        field: 'batteryCurrent',
        format: Formates.currentFormat),
    DetailItemModel(
        label: 'siteMonitor.dcPower'.tr, // '直流功率',
        field: 'PDC',
        format: Formates.powerFormat),
    DetailItemModel(
        label: 'siteMonitor.totalDcCurrent'.tr, //'直流总电流',
        field: 'TotalDcI',
        format: Formates.currentFormat),
  ];

  List<DetailItemModel> tempItems = [
    DetailItemModel(
      label: 'siteMonitor.ambientTemperature'.tr, //'环境温度',
      field: 'EnvironmentTemperature',
    ),
    DetailItemModel(
      label: ResKey.deviceIGBTTemp.tr, // 'IGBT温度',
      field: 'IgbtTemperature',
    ),
    DetailItemModel(
      label: 'siteMonitor.inductanceTemperature'.tr, //'电感温度',
      field: 'InductanceTemperature',
    ),
  ];

  List<DetailItemModel> versionItems = [
    DetailItemModel(
        label: sprintf('common.versionSentence'.tr, ['DSP-V']), //'DSP-V版本',
        field: 'DspVVersion'),
    DetailItemModel(
        label: sprintf('common.versionSentence'.tr, ['DSP-B']), //'DSP-B版本',
        field: 'DspBVersion'),
    DetailItemModel(
        label: sprintf('common.versionSentence'.tr, ['DSP-D']), //'DSP-D版本',
        field: 'DspDVersion'),
    DetailItemModel(
        label: sprintf('common.versionSentence'.tr, ['CPLD-V']), // 'CPLD-V版本',
        field: 'CpldVVersion'),
    DetailItemModel(
        label: sprintf('common.versionSentence'.tr, ['CPLD-B']), // 'CPLD-B版本',
        field: 'CpldBVersion'),
    DetailItemModel(
        label: sprintf('common.versionSentence'.tr, ['CPLD-D']), // 'CPLD-D版本',
        field: 'CpldDVersion'),
  ];
}
